#include <QApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include <QIcon>
#include "http.h"
#include "mysystemtrayicon.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setWindowIcon(QIcon(":/pic/icon")); //设置应用程序的图标

    qmlRegisterType<Http>("zy.qt.Http", 1, 2, "My_Translaton");
    qmlRegisterType<MySystemTrayIcon>("zy.qt.systemTrayIcon", 1, 3, "MySystemTrayIcon");

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

//    Http http;
//    http.setApiKey("uXoindbgL9Hf3HkfWfHOTtz8");
//    http.setUrl("http://openapi.baidu.com/public/2.0/translate/dict/simple");
//    http.setApiType(Http::ApiWordBadu);
//    http.setRequest("do");

//    MySystemTrayIcon trayIcon;
//    trayIcon.setIcon(":/pic/icon");
//    trayIcon.show();


    return app.exec();
}
